import { http } from "@/utils/http";
import { baseUrlApi } from "@/api/utils";
import { downloadFile } from "../file"
import { exportFile } from "../export";

export const getAllList = params => {
  return http.request("get", "/business/average-user-merchants-deal", params);
};
//查看灵工列表 use
export function getPageList(params) {
  return http.request("get", baseUrlApi("business/average_user_merchants_deal/merchants/list"), { params });
}

export function getNotSignList(params) {
  return http.request("get", "/business/average-user-merchants-deal/not-sign-paged-list", { params });
}

export const submitData = (params: any) => {
  return http.request(params.id ? "put" : "post", `/business/average-user-merchants-deal/${params.id ?? ""}`, {
    data: params
  });
};
// 查看灵工详情 use
export const getSingle = (id: number) => {
  return http.request("get", baseUrlApi(`business/average_user_merchants_deal/merchants/getById?averageUserDealId=${id}`));
};

// 查看灵工 协议 use
export const checkTheAgreement = (id: number) => {
  return http.request("get", baseUrlApi(`business/average_user_merchants_deal/checkTheAgreement?id=${id}`));
};
//查看灵工 删除 use
export const deleteData = (id: number) => {
  return http.request("get", baseUrlApi(`business/average_user_merchants_deal/hideDealBymerchants?id=${id}`));
};
//线下协议签约记录use
export function getList(params) {
  return http.request("get", baseUrlApi("business/merchantsAverageDeal/list"), { params });
};
//线下协议签约记录  查看 use
export function getInfoList(params) {
  return http.request("get", baseUrlApi("business/merchantsAverageDeal/getInfoList"), { params });
}